/**
 * 常用高级类型
 */
interface Todo {
  id: number
  title: string
  description: string
}

type PartialTodo = Partial<Todo>

type RequireTodo = Required<PartialTodo>

type ReadonlyTodo = Readonly<Todo>

type KeyV = Record<keyof Todo, Todo>

type PickTitle = Pick<Todo, 'title'>

type Excludea = Exclude<{ title: string }, Todo>
type Excludeb = Exclude<'title' | 'lll', 'lll'>

type Extracta = Extract<Todo, { title: string }>
function add<T>(value: Extract<T, object>): T {
  return value
}
const addRes = add({ name: 1 })

type OmitTitle = Omit<Todo, 'id' | 'title'>

type noNull = NonNullable<undefined | Todo | null | 'ssss'>

type AddFun = (value1: number, value2: number) => number
type returnParams = ReturnType<AddFun>
type params = Parameters<AddFun>
